import { request } from '@boeyo/portal';

/**
 * 电源列表
 * @ss.hasPermi('powerSupply:list')
 */
export const getPowerSupplyList = (params) => {
  return request({
    url: 'powerSupply/list',
    method: 'GET',
    params,
  });
};

/**
 * 保存电源信息
 * @ss.hasPermi('powerSupply:add')
 */
export const addPowerSupply = (data) => {
  return request({
    url: 'powerSupply/add',
    method: 'POST',
    data,
  });
};

/**
 * 删除智能电源
 * @ss.hasPermi('powerSupply:remove')
 */
export const deletePowerSupply = (ids) => {
  return request({
    url: `powerSupply/delete/${ids}`,
    method: 'DELETE',
  });
};

/**
 * 设备添加调用列表
 * @ss.hasPermi('powerSupply:deviceList')
 */
export const powerSupplyDeviceList = (params) => {
  return request({
    url: 'powerSupply/deviceList',
    method: 'GET',
    params,
  });
};

/**
 * 远程控制获取详情
 * @ss.hasPermi('powerSupply:detail')
 */
export const getPowerSupplyDetail = (powerSupplyId) => {
  return request({
    url: `powerSupply/queryById/${powerSupplyId}`,
    method: 'GET',
  });
};

/**
 * 电源关联设备强震仪列表
 * @ss.hasPermi('powerSupply:deviceListByPowerSupply')
 */
export const getDeviceListByPowerSupply = (id) => {
  return request({
    url: `powerSupply/deviceListByPowerSupply/${id}`,
    method: 'GET',
  });
};

/**
 * 远程控制命令执行
 * @ss.hasPermi('powerSupply:command')
 */
export const commandExec = (data) => {
  return request({
    url: 'powerSupply/commandExec',
    method: 'POST',
    data,
  });
};

/**
 * 厂商设备型号下拉
 * null
 */
export const modelOption = (params) => {
  return request({
    url: 'deviceModel/option',
    method: 'GET',
    params,
  });
};
